package org.pointex.util;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;

public class AjaxResult {
	/*
	 * Result = 1(成功)
	 * Result = 0(失败)
	 * message = 执行返回结果内容
	 * */

	public static final Integer RESULTSUCCESS = 1;
	public static final Integer RESULTERROR = 0;
	public static final String MESSAGESUCCESS = "成功";
	public static final String MESSAGEERROR = "失败";
	
	//执行结果状态
	private Integer result;
	//执行结果内容
	private String message;
	private String token;
	private Hashtable<Object, Object> information;
	
	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public AjaxResult() {
		
	}
	
	public AjaxResult(Integer result, String message) {
		this.result = result;
		this.message = message;
	}

	/*
	 * 执行成功
	 * */
	public static AjaxResult SuccessResult(){
		return new AjaxResult(RESULTSUCCESS, MESSAGESUCCESS);
	}

	/*
	 * 执行失败
	 * */
	public static AjaxResult ErrorResult(){
		return new AjaxResult(RESULTERROR, MESSAGEERROR);
	}
	
	public Integer getResult() {
		return result;
	}
	public void setResult(Integer result) {
		this.result = result;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}

	public Hashtable<Object, Object> getInformation() {
		return information;
	}

	public void setInformation(Hashtable<Object, Object> information) {
		this.information = information;
	}


}
